package com.syxx.oa.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.syxx.oa.dao.EmployeeDao;
import com.syxx.oa.domain.Employee;
import com.syxx.oa.service.EmployeeService;
import com.test.jbpm.Pager;

@Service
public class EmployeeServiceImpl implements EmployeeService{
	
	private EmployeeDao employeeDao;
	
	
	@Autowired
	public void setEmployeeDao(EmployeeDao employeeDao) {
		this.employeeDao = employeeDao;
	}

	public void addOrUpdate(Employee emp) {
		employeeDao.addOrUpdate(emp);
	}

	public void del(Long empId) {
		employeeDao.del(empId);
	}

	public void del(Long[] empIds) {
		for(Long empId : empIds){
			employeeDao.del(empId);
		}
	}

	public Employee findEmpById(Long empId) {

		return employeeDao.findEmpById(empId);
	}

	public Pager<Employee> findEmpList() {
		
		return employeeDao.findEmpList();
	}

	public Pager<Employee> findEmpListByDep(Long depId) {

		return employeeDao.findEmpListByDep(depId);
	}

	public Employee login(String cName,String cPassword){
		return employeeDao.login(cName,cPassword);
	}
}
